package com.wondertek.liveroom;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;

public class MyFragmentFactory {
	private static final String TAG = "MyFragmentFactory";
	public static Fragment createFragment(int type) {
		Fragment fragmentMain = null;
		if (type == 0) {
			System.out.println("------------fragment = new FragmentLive();-----------");
			fragmentMain = new FragmentMain();
		} 
//		else {
//			FragmentLiveClassify.cateId = type;
//			fragmentLive = new FragmentLiveClassify();			
//		}	
		return fragmentMain;
	}
	
	public static Fragment createLiveFragment(int type) {
		Fragment fragmentLive = null;
		if (type == 0) {
			fragmentLive = new FragmentLive();
		} else {
		//	FragmentLiveClassify.cateId = type;
			fragmentLive = new FragmentLiveClassify(type);
		}
		return fragmentLive;
	}
	
	public static Fragment createVideoFragment(int type) {
		Fragment fragmentVideo = null;
		if (type == 0) {
			fragmentVideo = new FragmentVideo();
		} else {
		//	FragmentVideoClassify.videoCateId = type;
			fragmentVideo = new FragmentVideoClassify(type);
		}
		return fragmentVideo;
	}
	
	public static Fragment createVideoPageFragment(int type) {
		Fragment fragment = null;
		switch(type) {
		case 0:
			fragment = new FragmentVideoDetails();
			break;
		case 1:
			fragment = new FragmentVideoDiscuss();
			break;
		case 2:
			fragment = new FragmentVideoMore();
			break;
		}	
		return fragment;
	}
	
	public static Fragment createFindFragment(int type) {
		Fragment fragment = null;
		switch(type) {
		case 0:
			fragment = new FragmentFindAll();
			break;
		case 1:
			fragment = new FragmentFindMine();
			break;
		}
		return fragment;
	}
	
	public static Fragment createLivePageFragment(int type) {
		Fragment fragment = null;
		switch(type) {
		case 0:
			fragment = new FragmentLiveChat();
			break;
		case 1:
			fragment = new FragmentLiveChatPersonal();
			break;
		case 2:
			fragment = new FragmentLiveChatMembers();
			break;
		case 3:
			fragment = new FragmentGift();
			break;
		}
		
		return fragment;
	}
}
